package com.dragee.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dragee.common.PageUtils;
import com.dragee.modules.sys.dao.SysUserRoleMapper;
import com.dragee.modules.sys.entity.SysUserRole;
import com.dragee.modules.sys.service.UserRoleService;
import com.dragee.utils.WrapperUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

@Service("userRoleService")
public class UserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements UserRoleService {




    private String business = "userRole";
    /**
    * 列表
    */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        QueryWrapper<SysUserRole> wrapper = WrapperUtil.getWrapper(business, params, SysUserRole.class);
        IPage<SysUserRole> page = WrapperUtil.getPage(params, SysUserRole.class);
        page = baseMapper.selectPage(page, wrapper.select());
        return new PageUtils(page);
    }
}